package org.csmzxy.class2334;
class Staff{
    String name;
    int salary;
}
public class Example02 {
    public static void  modifySalary(int salary){
        salary += 1000;
    }
    public static void modifySalary(Staff staff){
        staff.salary += 1000;
    }
    public static void main(String[] args){
        Staff staff= new Staff();
        staff.name ="刘晓璨";
        staff.salary=5000;
        System.out.println(staff.name+"的原本薪水："+staff.salary+"元/月");
        modifySalary(staff.salary);
        System.out.println("值传递加薪："+staff.name+"加薪后的薪水为"+staff.salary+"元/月");
        modifySalary(staff);
        System.out.println("引用传递加薪："+staff.name+"加薪后的薪水为"+staff.salary+"元/月");
    }
}